package com.sc.servlet.user.field;

import com.alibaba.fastjson.JSON;
import com.sc.pojo.Field;
import com.sc.services.FieldServices;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;

/**
 * @description: 将查看详情的场地号先存入session之后另一个html页面通过session获取id号，从而获取场地信息
 * @author: sc
 * @create: 2023-01-04 01:20
 **/
@WebServlet("/saveFieldId")
public class saveFieldIdServlet extends HttpServlet {

    private FieldServices fieldServices = new FieldServices();

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String fieldid = request.getParameter("fieldid");
        HttpSession session = request.getSession();
        session.setAttribute("fieldid",fieldid);
        System.out.println(fieldid);


    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}